package com.pinghua.mocha.basics.enumerate.smart;

import com.coffee.core.CoffeeEnum;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.math.BigDecimal;

/**
 * @author yangziyang
 * @since 2025/3/26
 */
public interface MerchantEnum {

    @Getter
    @AllArgsConstructor
    enum Type implements CoffeeEnum<Integer> {

        OTHER(0, "其他"),
        HOT_POT(1, "火锅"),
        DINING_HALL(2, "单位"),
        CHINESE_MEAL(3, "中餐"),
        EUROPEAN_FOOD(4, "西餐"),
        NOODLE(5, "面食"),
        SNACK(6, "小吃"),
        SOUP(8, "汤锅"),
        SCHOOL_CANTEEN(9, "学校"),
        ENTERPRISE_HALL(11, "机关"),
        ROAST(12, "烧烤"),
        HOTEL(13, "酒店"),
        COMPLEX(14, "综合体"),
        COMPREHENSIVE(15, "综合餐饮");

        @JsonValue
        private final Integer code;

        private final String label;


        @Override
        public Integer code() {
            return this.code;
        }

        @Override
        public String label() {
            return this.label;
        }

        public static Type ofCode(Integer code) {
            for (Type type : values()) {
                if (type.code.equals(code)) {
                    return type;
                }
            }
            return null;
        }

    }

    @Getter
    @AllArgsConstructor
    enum Level implements CoffeeEnum<Integer> {

        NORMAL(0, "普通商户"),
        POINT(1, "重点商户");

        @JsonValue
        private final Integer code;

        private final String label;


        @Override
        public Integer code() {
            return this.code;
        }

        @Override
        public String label() {
            return this.label;
        }
    }

    @Getter
    @AllArgsConstructor
    enum AddressType implements CoffeeEnum<Integer> {

        NORMAL(10, "正常"),
        HIGH_BUILDING(20, "楼上"),
        HIGH_MOUNTAIN(30, "山上");

        @JsonValue
        private final Integer code;

        private final String label;


        @Override
        public Integer code() {
            return this.code;
        }

        @Override
        public String label() {
            return this.label;
        }
    }

    @Getter
    @AllArgsConstructor
    enum IsSign implements CoffeeEnum<Integer> {

        UNSIGNED(0, "未签约"),
        SIGNED(1, "已签约");

        @JsonValue
        private final Integer code;

        private final String label;


        @Override
        public Integer code() {
            return this.code;
        }

        @Override
        public String label() {
            return this.label;
        }
    }

    @Getter
    @AllArgsConstructor
    enum Fre implements CoffeeEnum<String> {

        FRE_1("1.00", "每天一次"),
        FRE_2("0.50", "两天一次"),
        FRE_3("0.33", "三天一次"),
        FRE_4("0.25", "四天一次"),
        FRE_5("0.20", "五天一次"),
        FRE_6("0.17", "六天一次"),
        FRE_7("0.14", "七天一次"),
        FRE_8("0.01", "大于七天"),
        FRE_9("0.00", "90天未收");

        @JsonValue
        private final String code;

        private final String label;


        @Override
        public String code() {
            return this.code;
        }

        @Override
        public String label() {
            return this.label;
        }
    }
}
